import captchaSmsAdminApiConfig from '@/core/captchaSms/generated/apiconfig/captchaSmsAdminApiConfig'
import serverApiMockUtils from '../../utils/serverApiMockUtils'
import mockProdServerUtils from '../../utils/mockUtils'
import { MockMethod } from 'vite-plugin-mock'
import Mock from 'mockjs'
import CaptchaSmsItemConfigResponse from '@/core/captchaSms/generated/types/model/response/CaptchaSmsItemConfigResponse'

const content: CaptchaSmsItemConfigResponse[] = []
for (let i = 0; i < 10; i++) {
	content.push({
		id: i.toString(),
		title: `title_短信验证码配置_${i.toString()}`,
		remark: Mock.Random.integer(1, 2) == 1 ? null : `remark_短信验证码配置_${i.toString()}`,
		enable: Math.floor(Math.random() * 2) + 1 === 1,
		enableSystemCode: Math.floor(Math.random() * 2) + 1 === 1,
		systemCode: `systemCode_短信验证码配置_${i.toString()}`,
		attemptCount: i,
		expireInSeconds: `expireInSeconds_短信验证码配置_${i.toString()}`,
		sendIntervalInSeconds: `sendIntervalInSeconds_短信验证码配置_${i.toString()}`,
		codeString: `codeString_短信验证码配置_${i.toString()}`,
		codeLength: i,
		deleteFlag: '0',
		createTime: new Date().getTime().toString(),
		updateTime: new Date().getTime().toString(),
		rowVersion: 1,
	} as CaptchaSmsItemConfigResponse)
}

const mockList: MockMethod[] = [...serverApiMockUtils.getDefaultServerApi(captchaSmsAdminApiConfig.captchaSmsItemConfig, content)]

mockProdServerUtils.addMockList(...mockList)

export const items = content
